python プログラム


import tweepy

consumer_key = "tjsz27sNejWmRujl6yuDc2mIY"
consumer_secret = "bTWrCcWb6n8AMsbEANcdkHdDyd44Xe0ckI34msR7Tdy3azAkX6"
access_token = "1298136932178829312-QzOYO0JWtHsaMaBbuTpFSRk9zSuTEH"
access_token_secret = "bCZ11DzrHADXv2XwhcgNLvyVyvmT64N6p1ALvchpLQzfi"

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

# ツイート件数
keyword = '調べたいキーワード'
tweets_data = []

for tweet in tweepy.Cursor(
    api.search,
    q=keyword,
    tweet_mode='extended',
        lang='ja').items(1000):#最大で調べる件数
    tweets_data.append(tweet.full_text.strip().replace('\n', '。') + '\n')

print(len(tweets_data))